%
%
% test.m
%
% this test file is based on couch4mat tutorial.
% edited by H. Kim on Dec. 2011
% 
%
%

c=couch
% you have to modify the following line with your id/password
c.url='http://id:password@localhost:5984';

% create db
c=couch(c,'create db','mydb')

% get all databases
c=couch(c,'all_dbs')

% insert a row
d=couch(c,'insert doc','{"hello":"world"}');
% insert another row
lala.hello='world';lala.randM=rand(5);d=couch(c,'insert doc',lala)

% get all docs
c=couch(c,'all_docs')
c.db.all_docs

% modified by H. Kim on Dec. 2011
% row{end} in tutorial --> row(end) 
id = c.db.all_docs.rows(end).id
%[c,doc]=couch(c,'get doc',id)
doc=couch(c,'get doc',id)

% delete db
d=couch(c,'delete db')






